import { get, post } from '/@/api/http'
//这是后端网关的=路由
const serverContextPath = '/admin-server'
//systemApi是随便取得名字，到时候只把{}里边的内容拷贝到你的api.ts文件里去
export const systemApi = {
    /**
     * 分页查询#(table.getComment())
     * @param data {
          page: pagination.page,
          pageSize: pagination.pageSize,
          param: {...},
        }
     * @returns
     */
    query#(table.buildEntityClassName())ListPage: (data: any) => {
        return post({
            url: serverContextPath + '/#(firstCharToLowerCase(table.buildEntityClassName()))/page',
            data: data,
        })
    },
    /**
     * 新增#(table.getComment())
     * @param dataForm 参数
     * @returns
     */
    save#(table.buildEntityClassName())Info: (dataForm: any) => {
        return post({
            url: serverContextPath + '/#(firstCharToLowerCase(table.buildEntityClassName()))/save',
            data: dataForm,
        })
    },
    /**
     * 修改#(table.getComment())
     * @param dataForm 参数
     * @returns
     */
    update#(table.buildEntityClassName())Info: (dataForm: any) => {
        return post({
            url: serverContextPath + '/#(firstCharToLowerCase(table.buildEntityClassName()))/update',
            data: dataForm,
        })
    },

    /**
     * 删除#(table.getComment())
     * @param id 主键
     * @returns
     */
    delete#(table.buildEntityClassName())Info: (id: string) => {
        return post({
            url: serverContextPath + '/#(firstCharToLowerCase(table.buildEntityClassName()))/remove/' + id,
        })
    },
}